﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Share/Index.Master" Inherits="System.Web.Mvc.ViewPage<dynamic>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">

<% 
   BIZ.BookOper bookOper = new BIZ.BookOper();
   IList li = bookOper.getReturnRemind();
   if (li.Count > 0)
   {
%>
    <table cellspacing="0">
        <tr>
            <th>
                学员姓名
            </th>
            <th>
            图书量
            </th>
            <th >
                联系方式
            </th>
            <th>
            书名
            </th>
            <th>
            isbn
            </th>
         </tr>
<%
       int i = 0;
       int cNum = 0;
       int countLi = li.Count;
       string lbi_id="";
       StringBuilder sb = new StringBuilder();
       foreach (Hashtable tb in li)
       {
           cNum++;
           sb.Append("<tr>");
           if (lbi_id == "")//如果是第一个集合的开始
           {
               lbi_id = tb["lbi_id"].ToString();
               sb.Append("<td rowspan=\"rowspannum\">" + tb["u_name"].ToString() + "</td>");
               sb.Append("<td rowspan=\"rowspannum\">booksnum</td>");
               sb.Append("<td rowspan=\"rowspannum\">" + tb["u_tel1"].ToString() + "</td>");
           }
           if (lbi_id == tb["lbi_id"].ToString())
           {
               i++;
           }
           else//如果是下个集合的开始
           {
               sb.Replace("rowspannum",i.ToString());
               sb.Replace("booksnum", i.ToString());
               sb.Append("<td rowspan=\"rowspannum\">" + tb["u_name"].ToString() + "</td>");
               sb.Append("<td rowspan=\"rowspannum\">booksnum</td>");
               sb.Append("<td rowspan=\"rowspannum\">" + tb["u_tel1"].ToString() + "</td>");
               i = 1;
               lbi_id = tb["lbi_id"].ToString();
           }
           if (cNum == countLi)//如果是最后一笔记录
           {
               sb.Replace("rowspannum", i.ToString());
               sb.Replace("booksnum", i.ToString());
           }
           sb.Append("<td>"+tb["lbd_isbn"].ToString()+"</td>");
           sb.Append("<td>" + (tb["lb_bookName"] == null ? "" : BIZ.StringTool.Substring(tb["lb_bookName"].ToString(), 15, "...")) + "</td>");
           sb.Append("</tr>");
       }
       Response.Write(sb.ToString());
%>
    </table>
<%   
   }
   else
   {
       Response.Write("无符合条件的记录~");
   }
     
%>

</asp:Content>
